# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Gabriel Martinez < reitaka at gmail dot com >

pkgname=usbmuxd
pkgver=1.1.1
pkgrel=1
pkgdesc="USB Multiplex Daemon"
url="https://marcansoft.com/blog/iphonelinux/usbmuxd/"
arch=('x86_64')
license=('GPL2' 'GPL3')
depends=('libimobiledevice')
makedepends=('git' 'systemd')
_commit=79c8b38d1488a6b07e1e68f39d8caec3f1a45622
source=("git+https://github.com/libimobiledevice/usbmuxd#commit=$_commit" usbmuxd.sysusers)
sha256sums=('SKIP'
            '044bfb2810b27f7d6c066f142210775176b7484e76a78ea91794f40fdcda6fd9')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

check() {
  cd $pkgname
  make check
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin
  make
}

package() {
  cd $pkgname
  make DESTDIR="${pkgdir}" install

  install -Dm644 "$srcdir"/usbmuxd.sysusers "$pkgdir"/usr/lib/sysusers.d/usbmuxd.conf
}
